package com.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.data.request.ReqMasterList;
import com.example.entity.Master;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Author:yanghua
 * Date:2023/10/7 8:28
 */
@Mapper
public interface MasterDao extends BaseMapper<Master> {
    @Update("update master set del = 1 where id = #{id}")
    Integer deleteMasterById(Long id);

    List<Master> getMasterList(ReqMasterList reqMasterList);

    Integer getMasterListNumber(ReqMasterList reqMasterList);

    @Select("select * from master where username = #{username}")
    Master getMasterByUsername(String username);

    @Select("select * from master where id = #{id}")
    Master getMasterById(Long id);
}
